using Fiddler;

namespace TangCaptureTraffic.Services
{
    /// <summary>
    /// 会话格式化服务接口，定义会话格式化的核心功能
    /// </summary>
    public interface ISessionFormattingService
    {
        /// <summary>
        /// 将Fiddler会话对象转换为详细的可读字符串格式
        /// </summary>
        /// <param name="session">要转换的Fiddler会话对象</param>
        /// <returns>包含会话详细信息的格式化字符串</returns>
        string FormatSessionDetails(Session session);
        
        /// <summary>
        /// 获取会话的请求信息文本
        /// </summary>
        /// <param name="session">要转换的Fiddler会话对象</param>
        /// <returns>包含会话请求详细信息的格式化字符串</returns>
        string FormatRequestText(Session session);
        
        /// <summary>
        /// 获取会话的响应信息文本
        /// </summary>
        /// <param name="session">要转换的Fiddler会话对象</param>
        /// <returns>包含会话响应详细信息的格式化字符串</returns>
        string FormatResponseText(Session session);
        
        /// <summary>
        /// 格式化请求头
        /// </summary>
        /// <param name="session">会话对象</param>
        /// <returns>格式化的请求头字符串</returns>
        string FormatRequestHeaders(Session session);
        
        /// <summary>
        /// 格式化响应头
        /// </summary>
        /// <param name="session">会话对象</param>
        /// <returns>格式化的响应头字符串</returns>
        string FormatResponseHeaders(Session session);
        
        /// <summary>
        /// 格式化请求体
        /// </summary>
        /// <param name="session">会话对象</param>
        /// <param name="maxLength">最大长度限制</param>
        /// <returns>格式化的请求体字符串</returns>
        string FormatRequestBody(Session session, int maxLength = 5000);
        
        /// <summary>
        /// 格式化响应体
        /// </summary>
        /// <param name="session">会话对象</param>
        /// <param name="maxLength">最大长度限制</param>
        /// <returns>格式化的响应体字符串</returns>
        string FormatResponseBody(Session session, int maxLength = 5000);
        
        /// <summary>
        /// 将会话请求转换为cURL命令
        /// </summary>
        /// <param name="session">会话对象</param>
        /// <returns>cURL命令字符串</returns>
        string FormatRequestAsCurl(Session session);
    }
}